﻿<UserControl x:Class="VNet.VisiSuite.VisiCentral.Controls.Header2Control" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:vuc="clr-namespace:VNet.VisiSuite.Controls;assembly=VNet.VisiSuite.Controls" 
        xmlns:ctrl="clr-namespace:VNet.VisiSuite.VisiCentral.Controls"
        xmlns:ig="http://schemas.infragistics.com/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" x:Name="mywindow" Unloaded="OnUnloaded">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Assets/Styles/AppStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>

        <Grid Grid.Column="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0" Source="{Binding StaticData.LogoPath}" Margin="10,3,15,0" Focusable="False" />
            <vuc:MetroIconMenu Grid.Column="1" x:Name="_leftMenu" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,10,0,0" />
            <TextBlock Grid.Column="2" x:Name="_titleTblk" Style="{StaticResource SmallHeaderWhiteTextBlockStyle}" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding PageTitle}" />
        </Grid>
        
        <!--Navigation Control-->
        <StackPanel Orientation="Horizontal" Margin="0" Grid.Column="1" Visibility="Visible">
            <Button Command="{Binding PreviousShiftCommand}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Button.Template>
                    <ControlTemplate>
                        <Grid x:Name="grid" Background="Transparent">
                            <ContentControl ContentTemplate="{StaticResource AppbarChevronLeft }" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Button.Template>
            </Button>
            
            <ig:XamDateTimeInput x:Name="txtShiftDate" InvalidValueBehavior="RevertValue" DropDownButtonDisplayMode="Always" AlwaysValidate="True"
                    Value="{Binding ShiftDate, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Left" MinWidth="125"
                     Style="{StaticResource XamDateTimeInputStyle}">
                <ig:XamDateTimeInput.ValueConstraint>
                    <ig:ValueConstraint MaxInclusive="{Binding MaxShiftDate}"/>
                </ig:XamDateTimeInput.ValueConstraint>
            </ig:XamDateTimeInput>
            <ComboBox x:Name="cmbShift" MinWidth="125" VerticalAlignment="Center" Margin="8,0,0,0"
                      ItemsSource="{Binding ShiftList}" DisplayMemberPath="Description"
                      SelectedItem="{Binding Shift, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                       IsSynchronizedWithCurrentItem="True">
            </ComboBox>
            <Button Command="{Binding NextShiftCommand}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Button.Template>
                    <ControlTemplate>
                        <Grid x:Name="grid" Background="Transparent">
                            <ContentControl ContentTemplate="{StaticResource AppbarChevronRight }" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Button.Template>
            </Button>
        </StackPanel>
        <!--End of Navigation Control-->

        <Grid Grid.Column="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" x:Name="_datetime_text" VerticalAlignment="Center" HorizontalAlignment="Right" Style ="{StaticResource DateTimeTextBlockStyle}"/>
            <vuc:MetroIconMenu Grid.Column="1" x:Name="_rightMenu" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,10,8,0" />
        </Grid>
        
    </Grid>
</UserControl>
